cmake_minimum_required(VERSION 3.5)

set(${PROJECT_NAME} GPU-perf-cl)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-Wno-error=deprecated-declarations -Wno-deprecated-declarations ")

find_package(OpenCL REQUIRED)

set(EXAMPLES
    maxsp-compute
    maxdp-compute
    maxint-compute
    maxhalf-compute
    bs-download-speed
    bs-readback-speed
    gmem-read-bw
    fft-test
    gemm-test
)

foreach(EXAMPLE ${EXAMPLES})
  file(GLOB SOURCE ${EXAMPLE}/*.cpp)
  set(EXAMPLE_SRC ${EXAMPLE_SRC} ${SOURCE})
endforeach(EXAMPLE)

add_executable(${PROJECT_NAME} main.cpp  ${EXAMPLE_SRC})
add_dependencies(${PROJECT_NAME} clBLAS clFFT)
target_link_libraries(${PROJECT_NAME}
    OpenCL::OpenCL
    cl-common
    cl-framwork
    ${MATH_LIBRARIES}
    glfw
    ftgl
    freetype
    dlfcn
    pthread
    assimp m rt dl GLX X11 pthread)

include_directories(${CMAKE_SOURCE_DIR}/includes)
